package com.origin.src.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class XAspectJ {
    @Pointcut("execution(@com.origin.src.aspect.XAspectJA * com.origin..*(..))")
    public void xPointcut() {
    }

    @Before("xPointcut()")
    public void before(JoinPoint joinPoint) {
        System.out.println("before");
    }

    @After("xPointcut()")
    public void after(JoinPoint joinPoint) {
        System.out.println("after");
    }
//    @Around("xPointcut()")
//    public Object doAroundAdvice(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
//
//    }

    @DeclareParents(value = "com.origin.src.aspect.DeclareTest+", defaultImpl = DeclareParentImpl.class)
    DeclareParent declareParent;

}
